//
//  UIView+Event.m
//  s.
//
//  Created by fanshijian on 2022/8/22.
//  Copyright © 2022 J. All rights reserved.
//

#import "UIView+Event.h"

static const void * eventTransmissionBlockKey = &eventTransmissionBlockKey;

@implementation UIView (Event)

- (void)setEventTransmissionBlock:(CHGEventTransmissionBlock)eventTransmissionBlock {
    objc_setAssociatedObject(self, eventTransmissionBlockKey, eventTransmissionBlock, OBJC_ASSOCIATION_COPY);
}

- (CHGEventTransmissionBlock)eventTransmissionBlock {
    return objc_getAssociatedObject(self, eventTransmissionBlockKey);
}

- (void)addShadowC:(UIColor *)color
            offset:(CGSize)offset
           opacity:(CGFloat)opacity
            radius:(CGFloat)radius {
    self.layer.shadowColor = color.CGColor;//[UIColor colorWithRed:255/255.0 green:146/255.0 blue:99/255.0 alpha:0.2].CGColor;
    self.layer.shadowOffset = offset;
    self.layer.shadowOpacity = opacity;
    self.layer.shadowRadius = radius;
}

@end
